package com.easy.frame.servers.sys.mapping;

import com.easy.frame.servers.sys.dto.SysTenantAddDTO;
import com.easy.frame.servers.sys.dto.SysTenantUpdateDTO;
import com.easy.frame.servers.sys.entity.SysTenant;
import com.easy.frame.servers.sys.entity.SysTenantDetail;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * 租户表实体对象映射方法类
 *
 * @author tp
 * @date 2021/1/6 09:11
 */
@Mapper
public interface SysTenantMapping {

    SysTenantMapping INSTANCE = Mappers.getMapper(SysTenantMapping.class);

    SysTenant addDTO2PO(SysTenantAddDTO addDTO);

    SysTenant updateDTO2PO(SysTenantUpdateDTO updateDTO);

    SysTenantDetail addDTO2Deatil(SysTenantAddDTO addDTO);

    @Mapping(source = "id", target = "tenantId")
    SysTenantDetail updateDTO2Detail(SysTenantUpdateDTO updateDTO);

}
